﻿@using Seal.Model;
@{
    ReportViewTemplate Template = Model;

    //Template Name
    Template.Name = ReportViewTemplate.ChartNVD3Name;
    Template.Description = "Render the Chart NVD3 series of the page result.";

    //If true, the view can be configured for a report model
    Template.ForReportModel = false;
    Template.IsModelViewChild = true;

    //Parameters for this template
    Template.Parameters.Add(new Parameter() { Name = "nvd3_chart_width", DisplayName = "Chart width", Description = "The chart width. If empty, the size is automatic (responsive).", Enums = new string[] { "", "400px", "600px" }, UseOnlyEnumValues = false });
    Template.Parameters.Add(new Parameter() { Name = "nvd3_chart_height",  DisplayName = "Chart height", Description = "The chart height.", Enums = new string[] { "", "400px", "600px" }, UseOnlyEnumValues = false });
    Template.Parameters.Add(new Parameter() { Name = "nvd3_chart_contwidth",  DisplayName = "Chart container width", Description = "The width of chart in its container (vw is the % of the viewport width).", Enums = new string[] { "", "100vw", "90vw", "50vw", "400px" }, UseOnlyEnumValues = false });
    Template.Parameters.Add(new Parameter() { Name = "nvd3_chart_contheight", TextValue = "400px", DisplayName = "Chart container height", Description = "The height of the chart in its container (vh is the % of the viewport height).", Enums = new string[] { "100vh", "90vh", "50vh", "400px" }, UseOnlyEnumValues = false });
    Template.Parameters.Add(new Parameter() { Name = "nvd3_chart_title", DisplayName = "Chart title", Description = "Optional title displayed for the NVD3 chart. To handle drill navigation, the title can contain element label keyword like '%Label Text%' that will be replaced (e.g. 'Sales per %Order Month%')'." });
    Template.Parameters.Add(new Parameter() { Name = "nvd3_xaxis_range",DisplayName = "X Axis: Range", Description = "Minimum and maximum values for the axis. Two numeric values separated by a comma. This feature may depend on the chart type.", Enums = new string[] { "", "100,500","-1,1" }, UseOnlyEnumValues = false });
    Template.Parameters.Add(new Parameter() { Name = "nvd3_yaxis_range", DisplayName = "Y Axis: Range", Description = "Minimum and maximum values for the axis. Two numeric values separated by a comma. This feature may depend on the chart type.", Enums = new string[] { "", "100,500","-1,1" }, UseOnlyEnumValues = false });
    Template.Parameters.Add(new Parameter() { Name = "nvd3_xaxis_count", DisplayName = "X Axis: Number of values", NumericValue = 0, Description = "Number of X Axis values to display in the chart (e.g. to show the top 10 values). If 0, all the values are shown." });
    Template.Parameters.Add(new Parameter() { Name = "nvd3_hide_controls", DisplayName = "Force hide controls", BoolValue = false, Description = "If true, controls (depending on chart type) to interact with the series are hidden." });
    Template.Parameters.Add(new Parameter() { Name = "nvd3_show_legend", DisplayName = "Show legend", BoolValue = true, Description = "If true, the legend is displayed in the chart." });
    Template.Parameters.Add(new Parameter() { Name = "nvd3_bar_stacked", DisplayName = "Bar stacked", BoolValue = false, Description = "If true, the Bar in chart are stacked (only for Bar chart)." });
    Template.Parameters.Add(new Parameter() { Name = "nvd3_colors", DisplayName = "Colors", Description = "The list of colors used for the series (list of strings). By default, d3.scale.category10 or 20 colors are used.", Value = "d3", Enums = new string[] { "d3|D3 (default)", ReportViewTemplate.GoogleColors + "|Google", "d3b|D3 Category 20B Palette", "d3c|D3 Category 20C Palette", ReportViewTemplate.D3Colors }, UseOnlyEnumValues = false });
    Template.Parameters.Add(new Parameter() { Name = "nvd3_color_mappings", DisplayName = "Color mappings", Description = "If set, list of colors to use for specific label values. The mapping definition is an array of pair label and color (e.g. 'ok':'green','ko':'red').", Value = "", Enums = new string[] { "'ok':'green','ko':'red'" }, UseOnlyEnumValues = false });
    Template.Parameters.Add(new Parameter() { Name = "nvd3_margins", DisplayName = "Margins", Description = "Margins (in pixels) used for the chart.", Value = "auto", Enums = new string[] { "auto|Auto (default)", "{top:30, left:70, bottom:40, right:60}" }, UseOnlyEnumValues = false });
    Template.Parameters.Add(new Parameter() { Name = "nvd3_pie_labeltype", DisplayName = "Pie: Label type", Description = "The type of the label displayed in the slices.", Value = "percent", Enums = new string[] { "percent|Percentage", "value|Value", "key|Key", "none|No label" }, UseOnlyEnumValues = true});
    Template.Parameters.Add(new Parameter() { Name = "nvd3_pie_labelthreshold", DisplayName = "Pie: Label threshold", Description = "The minimum slice size for labels to show up (from 0 to 100).", NumericValue = 5 });
    Template.Parameters.Add(new Parameter() { Name = "nvd3_pie_holeratio", DisplayName = "Pie: Hole ratio", Description = "Relative size of the donut hole (from 0 to 100).", NumericValue = 35 });

    //Allowed template parent names
    Template.ParentNames = new List<string>() { "Model", "Container", "Widget", "Tab Page" };
}
  